package com.example.broadcastreceivertest;

import android.app.AlarmManager;
import android.content.Context;

/**
 * Created by qluan on 2015/4/7.
 */
public class TimerController {

    public static void setupTimerExplicitly(Context context) {
        AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 10 * 1000,
                NotificationSender.getPendingIntentExplicitly(context));
    }

    public static void setupTimerImplicitly(Context context) {
        AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        alarmManager.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + 10 * 1000,
                NotificationSender.getPendingIntentImplicitly(context));
    }
}
